// components/not-login/index.js
const $api = require('../../request/api').API;
import * as Storage from '../../utils/storage';
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    title: ''
  },
  options: {
    styleIsolation: 'shared'
  },
  /**
   * 组件的初始数据
   */
  data: {},
  /**
   * 组件的方法列表
   */
  methods: {
    getPhoneNumber(e) {
      let cond = {
        code: e.detail.code,
        appId: Storage.APPID
      };
      if (cond.code) {
        $api.getPhone(cond).then(res => {
          let phone = res.data.data;
          wx.setStorageSync('phone', res.data.data);
          wx.navigateTo({
            url: '/subcontract/person/pages/login/login/index?phone=' + phone
          });
        });
      }
    }
  }
});
